package com.hanxiang.hankol

//import com.hankol.material.MaterialMainHomeActivity
import android.annotation.SuppressLint
import android.content.Intent
import android.os.Bundle
import android.util.Log
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.baselibrary.Constants
import com.baselibrary.MessageBus
import com.baselibrary.base.mvvm.BaseViewModel
import com.baselibrary.router.ActivityRouter
import com.baselibrary.utils.ARouterUtils
import com.baselibrary.utils.HKToastUtils
import com.media.image.ImageModel
import com.media.revision.RevisionMediaActivity
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode

//import com.xinlan.imageeditlibrary.EditImgMainActivity

class MainActivity : AppCompatActivity() {
    @SuppressLint("MissingInflatedId")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        EventBus.getDefault().register(this)
       BaseViewModel().reqUpUserInfo();
        findViewById<TextView>(R.id.tv).setOnClickListener {
           ARouterUtils.jump("thd7pq://wineCellar/detail?id=202208114882&dealerCode=test1")
        }
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    fun onEvent(messageBus: MessageBus) {
        if (messageBus.codeType == MessageBus.msgid_notify_total_status) {
            Log.d("yuyang","${messageBus.param1}")
        } else if (messageBus.codeType == MessageBus.msgid_notify_total_progress) {
            Log.d("yuyang","${messageBus.param1}%")
        }
    }
}